from abc import ABC, abstractmethod
from xxsubtype import bench

from beverage import Beverage

class CondimentDecorator(Beverage, ABC):
    def __init__(self, beverage: Beverage):
        super().__init__()
        self._beverage = beverage


    @property
    def size(self):
        return self._beverage.size

    @size.setter
    def size(self, value: Beverage.Size):
        self._beverage.size = value

    @property
    def description(self):
        return None

    @abstractmethod
    def get_description(self):
        ...


class Milk(CondimentDecorator):
    def get_description(self):
        return self._beverage.get_description() + ", Milk"

    def cost(self):
        return .10 + self._beverage.cost()


class Mocha(CondimentDecorator):
    def get_description(self):
        return self._beverage.get_description() + ", Mocha"

    def cost(self):
        return .20 + self._beverage.cost()

class Soy(CondimentDecorator):
    def get_description(self):
        return self._beverage.get_description() + ", Soy"

    def cost(self):
        cost = self._beverage.cost()
        if self.size == self.Size.TALL:
            cost += .10
        elif self.size == self.Size.GRANDE:
            cost += .15
        elif self.size == self.Size.VENTI:
            cost += .20
        return cost


class Whip(CondimentDecorator):
    def get_description(self):
        return self._beverage.get_description() + ", Whip"

    def cost(self):
        return .10 + self._beverage.cost()